The present invention relates generally to the management of relational databases and more specifically to policy based automatic schema management for relational models.
Table partitioning is a well-known technique for space and data management of relational databases, in particular where a table of a relational database contains data that changes in operational importance over time. The table stores time-dependent data, for example data about financial transactions, each of which will have an associated date and time on which the transaction occurred. It may be deemed that only the last 5 months data is required, and that any older data can be discarded or archived.
In this way, the space required for the data of the table is managed. As an entire partition can be removed at once, this can be done much more efficiently than would be possible by deleting records individually.
However, space management can only be defined for any particular table in isolation. In addition, partition management policies cannot be used for tables that have primary key constraints that are referenced by other tables. This is because discarding a partition could lead to primary keys being discarded that are referenced by data in the other tables, leaving the other tables with dangling rows (i.e. rows that reference a primary key that no longer exists in the referenced table), causing foreign key constraint violations.